class Solution(object):
    def isSumEqual(self, firstWord, secondWord, targetWord):
        def convert(s):
            base = 0
            for c in s:
                base = base * 10 + ord(c) - ord('a')
            return base
        return convert(firstWord) + convert(secondWord) == convert(targetWord)
